#include "flash_blob.h" 

#define OPS_OFFSET ((uint32_t)&flash_code)

#define DEV_OFFSET ((uint32_t)&flash_dev)

#define RAM_OFFSET ((uint32_t)&rw_data)

static const uint32_t flash_code[] = 
{
    0X0E000300,0XD3022820,0X1D000940,0X28104770,0X0900D302,0X47701CC0,0X47700880,0X49414842,
    0X49426041,0X21036041,0X68C16001,0X431122F0,0X694060C1,0XD4060680,0X493D483E,0X21066001,
    0X493D6041,0X20006081,0X48374770,0X05426901,0X61014311,0X47702000,0X4833B510,0X24046901,
    0X61014321,0X03A26901,0X61014311,0X4A314933,0X6011E000,0X03DB68C3,0X6901D4FB,0X610143A1,
    0XBD102000,0XF7FFB530,0X4927FFBB,0X23F068CA,0X60CA431A,0X610C2402,0X0700690A,0X43020E40,
    0X6908610A,0X431003E2,0X48246108,0XE0004A21,0X68CD6010,0XD4FB03ED,0X43A06908,0X68C86108,
    0X0F000600,0X68C8D003,0X60C84318,0XBD302001,0X4D15B570,0X08891CC9,0X008968EB,0X433326F0,
    0X230060EB,0X4B16612B,0X692CE017,0X612C431C,0X60046814,0X03E468EC,0X692CD4FC,0X00640864,
    0X68EC612C,0X0F240624,0X68E8D004,0X60E84330,0XBD702001,0X1D121D00,0X29001F09,0X2000D1E5,
    0X0000BD70,0X45670123,0X40023C00,0XCDEF89AB,0X00005555,0X40003000,0X00000FFF,0X0000AAAA,
    0X00000201,0X00000000,
};

static const uint32_t flash_dev[] = 
{
    0X54530101,0X4632334D,0X20787834,0X73616C46,0X00000068,0X00000000,0X00000000,0X00000000,
    0X00000000,0X00000000,0X00000000,0X00000000,0X00000000,0X00000000,0X00000000,0X00000000,
    0X00000000,0X00000000,0X00000000,0X00000000,0X00000000,0X00000000,0X00000000,0X00000000,
    0X00000000,0X00000000,0X00000000,0X00000000,0X00000000,0X00000000,0X00000000,0X00000000,
    0X00010000,0X08000000,0X00100000,0X00000400,0X00000000,0X000000FF,0X00000064,0X00001770,
    0X00004000,0X00000000,0X00010000,0X00010000,0X00020000,0X00020000,0XFFFFFFFF,0XFFFFFFFF,
};

static uint32_t rw_data[] = 
{
    0X00000000,
};

static flash_blob_t  flash_blob =
{
    (void*)(OPS_OFFSET + 0X001D),  // Init
    (void*)(OPS_OFFSET + 0X004B),  // UnInit
    (void*)(OPS_OFFSET + 0X0059),  // EraseChip
    (void*)(OPS_OFFSET + 0X0085),  // EraseSector
    (void*)(OPS_OFFSET + 0X00D1),  // ProgramPage
    (void*)(DEV_OFFSET),
    (void*)(RAM_OFFSET),
};

static int flash_blob_device_register(void) 
{                                            
    flash_dev_register(&flash_blob);       
    return 0 ;                                
}                                               
INIT_BOARD_EXPORT(flash_blob_device_register);
